<?php
/**
 * Singgle
 * The main template file for display single page.
 * Author : vthanh_88
 * @package WordPress
*/
get_header();
wp_enqueue_script('prettyPhoto');
?>
        	<!-- Portfolio Content Start -->
			<?php
			if(have_posts()): the_post();
			$imagethumb = '';
            $image_fullwidth ='';
            
            
            if(has_post_thumbnail())
            {
            $imageid=get_post_thumbnail_id(get_the_ID());
            $imagethumb = wp_get_attachment_image_src($imageid,'size-680-300');
            $image_fullwidth = wp_get_attachment_image_src($imageid,'size-680-300');
            
            }
			$portfolio_single_enable_category = get_theme_option('portfolio','portfolio_single_enable_category');
            $portfolio_single_enable_author = get_theme_option('portfolio','portfolio_single_enable_author');
            $portfolio_single_enable_date = get_theme_option('portfolio','portfolio_single_enable_date');
            $portfolio_single_enable_link_direct = get_theme_option('portfolio','portfolio_single_enable_link_direct');
            $type_portfolio = get_meta_option('portfolio_type',get_the_ID());

?>
<!-- About Content Start -->
	 <div class="wrapper">
        <?php get_sidebar(); ?>		 
    	 <div class="right-panel-outer">
            <div class="right-panel">
                <div class="right-inner">
                    <h2 class="head"><?php the_title(); ?></h2>
                    
                    <div class="blog-post">
                    	<div class="blog-date">
                        	<span><?php echo get_the_time('M'); ?> / <?php echo get_the_time('d'); ?></span>
                            <span><a href="#">15</a></span>
                        </div>
                        <div class="mosaic-block bar2">
                            <div class="mosaic-overlay">
                                <div class="details">
                                    <h2><?php the_title(); ?></h2>
                                    <?php
                					$enable_lightbox =get_theme_option('portfolio','portfolio_enable_lightbox');
                					$types_portfolio=get_the_terms(get_the_ID(),'portfolio-types');
									$video = get_meta_option('video_embed_code',get_the_ID());
                                    $video_embed=get_meta_option('video_embed_code',get_the_ID());
                                    $youtube_video = get_meta_option('youtube_id',get_the_ID());
                                    $vimeo_video = get_meta_option('vimeo_id',get_the_ID());
                                    $video_style = get_meta_option('video_style',get_the_ID());
                                    
                                    
                                    $direct_link = get_meta_option('direct_url_portfolio',get_the_ID());
                                    
                                    $portfolio_number_chacter =get_theme_option('portfolio','portfolio_number_chacter');
                                    $portfolio_number_chacter =get_theme_option('portfolio','portfolio_number_chacter');
                                    $portfolio_readmore_link =get_theme_option('portfolio','portfolio_readmore_link');
                                    if($enable_lightbox=='true'): ?>
        											   <?php if($type_portfolio=='1') : $image_upload=get_meta_option('image_upload_portfolio',get_the_ID()); ?>
                                                       <div><a rel="prettyPhoto" class="zoom-icon" href="<?php echo $image_upload; ?>" title="<?php the_title(); ?>">&nbsp;</a> <a href="<?php  echo get_permalink() ?>" class="plus-icon">&nbsp;</a></div>
        											 <?php elseif($type_portfolio=='2') :
                                                       if($video_style =="embed") :
                                						?>
                        						   	    
														<div><a rel="prettyPhoto" class="video-icon"   href="#video<?php echo $sum?>" title="<?php the_title(); ?>"></a><a href="<?php  echo get_permalink() ?>" class="plus-icon">&nbsp;</a></div>
                                						<?php 
                        								elseif($video_style =="youtube") :
                        								?>
                        								
                        						  		 <div><a rel="prettyPhoto" class="video-icon"   href="http://www.youtube.com/watch?v=<?php echo $youtube_video;?>" title="<?php the_title(); ?>"></a><a href="<?php  echo get_permalink() ?>" class="plus-icon">&nbsp;</a></div>
                        								<?php
                        								elseif($video_style =="vimeo") :
                        								?>
                        								
                        						   		<div><a href="http://vimeo.com/<?php echo $vimeo_video;?>"  class="video-icon" rel="prettyPhoto" title="<?php the_title(); ?>"></a><a href="<?php  echo get_permalink() ?>" class="plus-icon">&nbsp;</a></div>
                    									<?php endif; ?>
        											  <?php elseif($type_portfolio=='3') : $image_upload=get_meta_option('image_upload_portfolio',get_the_ID());
        												$direct_url_portfolio=get_meta_option('direct_url_portfolio',get_the_ID());
                                 						?>
                 								
                         								<div><a rel="prettyPhoto[iframes]" class="link-icon" href="<?php  echo $direct_url_portfolio; ?>?iframe=true&width=100%&height=100%" title="<?php the_title(); ?>"></a><a href="<?php  echo get_permalink() ?>" class="plus-icon">&nbsp;</a></div>
                         						
                         								<?php endif; ?>
													<?php else: ?>
													
														<div><a href="<?php  echo get_permalink() ?>" class="plus-icon">&nbsp;</a></div>
													<?php endif ?>
											
                                </div>
                            </div>
                            <div class="mosaic-backdrop"><img src="<?php echo $imagethumb[0];?>" alt=""></div>
                        </div>
                        <div class="clearfix"></div>                        
                    </div>
					<div>	<ul class="cont-txt" style="margin-top:0px;">
                               	
								<?php 
                                   $types=get_the_terms(get_the_ID(), 'portfolio-types');
								   $types_arr=array();
								   $num=0;
								   if($types) :
                             		   foreach($types as $type):
    									  $types_arr[$num]='<a href="'.get_term_link($type->slug, "portfolio-types").'">'.$type->name.'</a>';
    									  $num++;
                             		   endforeach;
								   endif;
                                 ?>
								<?php if(get_theme_option('portfolio','portfolio_single_enable_category') == 'true'): ?> 
								<li class="email">
								
								 <?php echo esc_html__('Types : ','TT').implode(',',$types_arr); ?>
								 
								</li>
								<?php endif; ?>
                           		<?php if($portfolio_single_enable_link_direct =='true' && $type_portfolio == '3' ) : ?>
                                
								<li class="link-url"><a href="<?php echo get_meta_option('direct_url_portfolio',get_the_ID()) ?>">Visit Site</a></li>
                           		
								<?php endif; ?>
								<?php if($portfolio_single_enable_author == 'true'): ?>
                           		
								<li class="link-url"><?php echo esc_html__('Author : ','TT') ?><?php the_author(); ?></li>
								<?php endif; ?>
                           		
								<?php if($portfolio_single_enable_date == 'true'): ?>
                           		
								<li class="link-url"><?php echo esc_html__('Date : ','TT') ?><?php the_date(); ?></li>                           		
								<?php endif; ?>
        						
             		
                             </ul>
                         </div>
                    <?php the_content(); ?>
                </div>
                <div class="clearfix"></div>
                <div class="seperator"><img src="<?php echo SKIN_URI; ?>/star_bg.png" alt=""></div>
			</div>
			

            <div class="content-shadow">&nbsp;</div>
        </div>
        <div class="clearfix"></div>
	</div>
<?php
endif;
get_footer(); 
?>